{include file="index:head" /}
<div class="topimg" style="background:url({$banner|default='_CN_/img/topimg.jpg'}) no-repeat center top"></div>
<div class="about-con1">
  <div class="wrap"> {include file="common:map" /}
    <div class="pdbox"> {$one.content|htmlspecialchars_decode} </div>
  </div>
</div>
<div class="about-con2">
  <div class="wrap">
    <div class="title">
      <p>C O U R S E</p>
      <p class="line"></p>
      <h2>在线留言</h2>
      </div>
    <div class="book">
    <form action="{:url('Show/sendemail')}" method="post" data-type="ajax">
      <p>
        <input type="text" name="company" class="intxt i1" placeholder="公司">
        <input type="text" class="intxt i2" name="job" placeholder="职位">
      </p>
      <p>
        <input type="text" name="name" class="intxt i1" placeholder="姓名">
        <input type="text" class="intxt i2" name="mobile" placeholder="手机">
      </p>
      <p>
        <input type="text" name="email" class="intxt i1" placeholder="邮箱">
        <input type="text" class="intxt i2" name="address" placeholder="地址">
      </p>
      <p>
        <textarea name="content" class="intxt te" placeholder="留言内容"></textarea>
      </p>
      <p>
        <input type="submit" value="提交" class="sbtn">
      </p>
    </form>
  </div>
  </div>
</div>
<script src="/public/layer/layer.js"></script> 
  <script>
$(document).on('submit','form[data-type=ajax]',function(){
	var url = $(this).attr('action');var data = $(this).serializeArray();
	if($("input[name=company]").val()==""){ layer.msg("请输入公司名称"); return false; }
	if($("input[name=job]").val()==""){ layer.msg("请输入职位"); return false; }
	if($("input[name=name]").val()==""){ layer.msg("请输入姓名"); return false; }
	if($("input[name=mobile]").val()==""){ layer.msg("请输入手机"); return false; }	
	var phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/;	
	var phone = $.trim($("input[name=mobile]").val());
	if (!phoneReg.test(phone)) {
		layer.msg('手机号码格式错误');
		return false;
	} 
	if($("input[name=email]").val()==""){ layer.msg("请输入邮箱"); return false; }
	var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
    if(!myreg.test($("input[name=email]").val())){
		layer.msg('邮箱格式错误');		
	   return false;
    }	
	if($("textarea[name=content]").val()==""){ layer.msg("请输入内容"); return false; }
	$.post(url,data,function(res){		
		if(res.code == 1){ 
			layer.msg('提交成功'); 
			setTimeout(function(){			
				window.location.reload(); 
			},1500)
		}
	},"JSON");
	return false;
});
</script>
{include file="index:foot" /}